<template>
  <div class="about">
    <!--面包屑导航-->
    <el-breadcrumb separator-class="el-icon-arrow-right">
      <el-breadcrumb-item>首页</el-breadcrumb-item>
      <el-breadcrumb-item>系统工具类</el-breadcrumb-item>
      <el-breadcrumb-item>关于我们</el-breadcrumb-item>
    </el-breadcrumb>
    <el-card>
      <!-- 二维码 -->
      <div class="qrcode-class">
        <canvas id="canvas"></canvas>
      </div>
    </el-card>
  </div>
</template>

<script>
import Vue from 'vue'
// 使用二维码插件
import QRCode from 'qrcode'
Vue.use(QRCode)

export default {
  name: 'about',
  mounted () {
    this.showqrcode()
  },
  methods: {
    // 展示二维码
    showqrcode () {
      const canvas = document.getElementById('canvas')
      QRCode.toCanvas(canvas, 'https://blog.csdn.net/FBB360JAVA', function (error) {
        if (error) {
          console.log(error)
        } else {
          // 成功
          console.log('二维码生成成功！')
        }
      })
    }
  }
}
</script>
